package response

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

type ResponseData struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func Response(ctx *gin.Context, code int, msg string, data any) {
	resp := ResponseData{
		Code: code,
		Msg:  msg,
		Data: data,
	}

	ctx.JSON(http.StatusOK, resp)
}
